<template>
  <div class="goods-params" v-if="Object.keys(goodsParams).length !== 0">
    <div class="size">
      <h3>{{ goodsParams.rule.key }}</h3>
      <table>
        <tr :key="index2" v-for="(item, index2) in goodsParams.rule.tables[0]">
          <td :key="index3" v-for="(td, index3) in item">{{ td }}</td>
        </tr>
      </table>
    </div>
    <div class="info">
      <h3>{{ goodsParams.info.key }}</h3>
      <table>
        <tr :key="index2" v-for="(item, index2) in goodsParams.info.set">
          <td>
            <h4>{{ item.key }}</h4>
          </td>
          <td>
            <span>{{ item.value }}</span>
          </td>
        </tr>
      </table>
    </div>
  </div>
</template>

<script>
export default {
  name: "DetailGoodsParams",
  props: {
    goodsParams: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style scoped>
.goods-params {
  margin: 10px 10px 0 10px;
}
.size {
  width: 100%;
  margin: 20px 0 30px auto;
}
.size table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  margin: 10px 0 10px 0;
}
.size tr {
  height: 30px;
}
.size td {
  width: 30px;
  border-bottom: 1px solid #eee;
}

.info table {
  width: 100%;
  font-size: 14px;
  border-collapse: collapse;
  margin: 10px 0 10px 0;
}
.info tr {
  height: 30px;
}
.info td {
  width: 30px;
  border-bottom: 1px solid #eee;
}
.info td span {
  color: var(--color-tint);
}
</style>
